package com.example.birdexpress.indentstalker;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/*
* 推送接口
* */
@Controller
public class CallBackController {
    /*
    *参数的接收
    * */
    public Map<String,String> getParam(HttpServletRequest request){
        Map<String,String> map = new HashMap<>();
        Map<String,String[]> Obj = request.getParameterMap();
        for (Map.Entry<String, String[]> entry : Obj.entrySet()) {
            String name = entry.getKey();
            String[] values = entry.getValue();
            System.out.println("参数名称:"+name+"参数值："+values[0]);
            map.put(name,values[0]);
        }
        return map;
    }

    @ResponseBody
    @RequestMapping("/back_stalker")
    public void subscribe(HttpServletRequest request) {
        Map<String,String> param = getParam(request);
        return ;
    }
}
